package com.example.demo.service;

import com.example.demo.mapper.UserMapper;
import com.example.demo.pojo.Book;
import com.example.demo.pojo.Borrow;
import com.example.demo.pojo.User;
import com.example.demo.pojo.UserInfo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper mapper;

    @Override
    public List<User> findUser(User user) {
        return mapper.findUser(user);
    }

    @Override
    public void insertUser(User user) {
        mapper.insertUser(user);
    }

    @Override
    public List<Book> getBooks(Book book) {
        return mapper.getBooks(book);
    }

    @Override
    public List<UserInfo> getUserInfo(UserInfo userInfo) {
        return mapper.getUserInfo(userInfo);
    }

    @Override
    public void updateUser(User user) {
        mapper.updateUser(user);
    }

    @Override
    public void updateUserInfo(UserInfo userInfo) {
        mapper.updateUserInfo(userInfo);
    }

    @Override
    public void deleteUser(User user) {
        mapper.deleteUser(user);
    }

    @Override
    public void deleteUserByIds(List<Integer> ids) {
        mapper.deleteUserByIds(ids);
    }

    @Override
    public void insertUserInfo(UserInfo userInfo) {
        mapper.insertUserInfo(userInfo);
    }

    @Override
    public void BorrowBook(Borrow borrow) {
        mapper.BorrowBook(borrow);
    }

    @Override
    public void insertBook(Book book) {
        mapper.insertBook(book);
    }

    @Override
    public List<Map<String, Object>> getBorrow(String name) {
        return mapper.getBorrow(name);
    }

    @Override
    public void updateBook(Book book) {
        mapper.updateBook(book);
    }

    @Override
    public void returnBook(Borrow borrow) {
        mapper.returnBook(borrow);
    }

    @Override
    public void updateStatus(Borrow borrow) {
        mapper.updateStatus(borrow);
    }

}
